/**
 * @file first_fit.c
 * @brief 
 * @author WeixiongLin (wx_lin@outlook.com)
 * @version 1.0
 * @date 2022-09-19
 * 
 * @copyright Copyright (c) 2022  WeixiongLin
 * 
 * @par 修改日志:
 * <table>
 * <tr><th>Date       <th>Version <th>Author  <th>Description
 * <tr><td>2022-09-19 <td>1.0     <td>WeixiongLin     <td>内容
 * </table>
gcc -c first_fit.c malloc.c && gcc first_fit.o malloc.o -o main && ./main
 */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include "malloc.h"


int main() {
    size_t x = 0;

    int size = 8;
    int *p1 = (int *) ff_malloc(size * sizeof(int));

    for (int i = 0; i < size; i++) {
        *(p1 + i) = i;
    }
    for (int i = 0; i < size; i++) {
        printf("%d ", *(p1 + i));
    }
    ff_free(p1);

    printf("\n");
    for (int i = 0; i < 9; i++) {
        printf("%d ", *(p1 + i));
    }

    // int *p2 = (int *) ff_calloc(3, 10);

    return 0;
}
